#include <iostream>
#include <cstdio>
#include <vector> 
#include <algorithm>
#include <cstdlib>
#include <utility> 

using namespace std; 

struct vlt_t {
	int id, s; 
}; 

bool cmp(vlt_t &a, vlt_t &b)
{
	if (a.s==b.s) 
		return a.id<b.id; 
	return a.s>b.s; 
}

int main()
{
	vector<vlt_t> a; 
	unsigned i, n, m, x;
	int line; 
	vlt_t v; 
	
	//freopen("p1068_2.in", "r", stdin); 

	cin>>n>>m; 
	for(i=0; i<n; i++) {
		cin>>v.id>>v.s; 
		a.push_back(v); 
	}
	sort(a.begin(), a.end(), cmp); 

	line = a[(int)(1.5*m)-1].s; 

	for(x=0, i=0; i<n; i++) {
		vlt_t &v = a[i]; 
		if (v.s>=line) {
			x++; 
		}
	}
	cout<<line<<" "<<x<<"\n"; 
	for (i=0; i<x; i++) {
		vlt_t &v = a[i]; 
		cout<<v.id<<" "<<v.s<<"\n"; 
	}

	return 0; 
}


